<template>
  <div>

    <table border="1px" >
      <tr>
        <td>班级ID</td>
        <td>班级名称</td>
        <td>专业方向</td>
      </tr>
      <tr v-for="(i,j) in list" :key="j">
        <td>{{i.id}}</td>
        <td>{{i.name}}</td>
        <td>{{i.direction}}</td>
      </tr>
    </table>
    <el-pagination
  background
  layout="prev, pager, next"
  :total="total"
  :page-size="page_size"
  @current-change="change"
  >
</el-pagination>
  </div>
</template>

<script>
export default {
  data(){
    return{
      list:[],
      page_size:0,
      total:0,
      page:1
    }
  },
  methods:{
    getBjfy(){
      this.axios.get("users/get?page="+this.page).then(res=>{
        this.page_size = res.data.page_size
        this.total = res.data.total
        this.list = res.data.flist
      })
    },
    change(number){
            this.page = number
            this.getBjfy()
    },
  },
  mounted(){
    this.getBjfy()
  }

}
</script>

<style>

</style>